package com.mitake.nick;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class HelloWorldController {//implements Controller
    
	@RequestMapping(value = "/hello", method = RequestMethod.POST)
    public ModelAndView handleRequest(HttpServletRequest req,HttpServletResponse res) throws Exception {
 
		String username = req.getParameter("name");
		
        String message = "Hello "+ username;
        return new ModelAndView("hello", "message", message);
    }
    
}
